package com.woniuxy01;

import java.util.Scanner;

/**
 * @author 作者
 * @create 2025-07-17 14:02
 */
public class Test08 {
    public static void main(String[] args) {
//        Scanner sc = new Scanner(System.in);
//        String answer;
//        do{
//            System.out.println("猜数字");
//            System.out.println("是否继续y/n");
//            answer = sc.next();
//        }while ("y".equals(answer));
//
//        System.out.println("Game over");


//        Scanner sc = new Scanner(System.in);
//        System.out.println("是否开始游戏y/n");
//        String answer=sc.next();
//        while(answer.equals("y")){
//            System.out.println("猜数字");
//            System.out.println("是否继续y/n");
//            answer=sc.next();
//        }
//        System.out.println("Game over");
        Scanner sc = new Scanner(System.in);
        System.out.println("是否开始游戏y/n");
        String answer = sc.next();
        do {
            if (!answer.equals("y")) {
                break;
            }
            System.out.println("猜数字");
            System.out.println("是否继续y/n");
            answer = sc.next();
        } while (true);
        System.out.println("Game over");

    }
}
